﻿
#include <iostream>
#include "../../win_com/xx_process.hpp"
#include "../../win_com/xx_pe.hpp"
#include "../../win_com/xx_inline_hook.hpp"
#include "../../win_com/xx_mem.hpp"

int WINAPI My_MessageBoxA(
    _In_opt_ HWND hWnd,
    _In_opt_ LPCSTR lpText,
    _In_opt_ LPCSTR lpCaption,
    _In_ UINT uType) {

    printf("MessageBoxA call,%s,%s\n\n", lpText, lpCaption);
    return 0;
}

int main()
{
    printf("MessageBoxA addr=0x%p \n\n", &MessageBoxA);

    // 1、hook
    xx_mem_unprotect(&MessageBoxA, 1024);
    xx_setjmp(&MessageBoxA, &My_MessageBoxA);
    ::MessageBoxA(0, "@@@", "###", 0);
    
    // 2、code check
    auto dll = GetModuleHandleA("User32.dll");
    pe_code_check_ret ret = xx_module_check_by_handle(dll);
    ret.print();
    return 0;
}


